package com.sdcqjy.property.mode;

import android.text.TextUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * Created by 磁磁帅 on 2018/5/13.
 * 功能：
 */

public class MessageMode {
    /**
     * id : 2
     * userID : 48
     * messageContent : 测试没有关联文档
     * messageTitle : 测试没有关联文档
     * documentID : 0
     * isRead : 0
     * createTime : 20180512145053
     * actionTime : 20180512145053
     * userIDs : null
     */

    public long id;
    //public long userID;
    public String messageContent;
    public String messageTitle;
    public long documentID;
    public long isRead;
    private String createTime;
    public long actionTime;
    //public Object userIDs;
    public String time;

    public String getTime() {
        if (TextUtils.isEmpty(time)) {
            SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
            long timeL;
            try {
                timeL = format.parse(createTime).getTime();
            } catch (ParseException e) {
                timeL = actionTime;
            }
            format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            time = format.format(timeL);
        }
        return time;
    }
}
